<%@ page language="java" 

import="java.util.*" 
import="edu.cnu.tpts.dao.TeacherDao" 
import="edu.cnu.tpts.dao.impl.TeacherDaoImpl" 
import="edu.cnu.tpts.bean.Teacher" 
import="edu.cnu.tpts.bean.Student" 
import="edu.cnu.tpts.bean.Course" 

 pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/authorize.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'showTeacher.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
     <a href="teacher/index.jsp">教师主页</a>
  <hr/>

    	<%
    	TeacherDao teacherDao=new TeacherDaoImpl();
   		String scoreIdStr=request.getParameter("scoreId");
   		int scoreId=0;
   		if(null==scoreIdStr||"".equals(scoreIdStr)||"null".equals(scoreIdStr)){
   		
   		}else{
   		scoreId=Integer.parseInt(scoreIdStr);
   		}
		boolean deleteFlag=teacherDao.deleteStudentScore(scoreId);
	
		if(true==deleteFlag){
		//request.setAttribute("info"," 学生成绩删除成功！");
		request.getRequestDispatcher("/teacher/showStudentScore.jsp").forward(request,response);
		}else{
		//request.setAttribute("info"," 学生成绩删除失败！");
		request.getRequestDispatcher("/teacher/showStudentScore.jsp").forward(request,response);
		}
   
    	 %>
   
  </body>
</html>
